package vn.co.thn.android.store.fragment;

import vn.co.thn.android.store.util.NSRequestService.NSRequestProcessUI;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;

public class NSCommonFragment extends Fragment implements NSRequestProcessUI {
	protected FragmentManager mManager;
	private ProgressDialog progressDialog;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		mManager = getActivity().getSupportFragmentManager();
		progressDialog = new ProgressDialog(getActivity());
		progressDialog.setIndeterminate(true);
		progressDialog.setCancelable(false);
		progressDialog.setMessage("loading...");
	}

	public Fragment findFragmentById(int resid) {
		return mManager.findFragmentById(resid);
	}

	@Override
	public void ShowProcess() {
		// TODO Auto-generated method stub
		progressDialog.show();
	}

	@Override
	public void HideProcess() {
		// TODO Auto-generated method stub
		progressDialog.dismiss();
	}
	public void setMessageProcess(String TextMessage){
		progressDialog.setMessage(TextMessage);
	}
}
